<?xml version="1.0" encoding="ascii"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
          "DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>spaceship.Bonus</title>
  <link rel="stylesheet" href="epydoc.css" type="text/css" />
  <script type="text/javascript" src="epydoc.js"></script>
</head>

<body bgcolor="white" text="black" link="blue" vlink="#204080"
      alink="#204080">
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

      <th class="navbar" width="100%"></th>
  </tr>
</table>
<table width="100%" cellpadding="0" cellspacing="0">
  <tr valign="top">
    <td width="100%">
      <span class="breadcrumbs">
        <a href="spaceship-module.html">Module&nbsp;spaceship</a> ::
        Class&nbsp;Bonus
      </span>
    </td>
    <td>
      <table cellpadding="0" cellspacing="0">
        <!-- hide/show private -->
        <tr><td align="right"><span class="options">[<a href="javascript:void(0);" class="privatelink"
    onclick="toggle_private();">hide&nbsp;private</a>]</span></td></tr>
        <tr><td align="right"><span class="options"
            >[<a href="frames.html" target="_top">frames</a
            >]&nbsp;|&nbsp;<a href="spaceship.Bonus-class.html"
            target="_top">no&nbsp;frames</a>]</span></td></tr>
      </table>
    </td>
  </tr>
</table>
<!-- ==================== CLASS DESCRIPTION ==================== -->
<h1 class="epydoc">Class Bonus</h1><span class="codelink"><a href="spaceship-pysrc.html#Bonus">source&nbsp;code</a></span><br /><br />
<pre class="base-tree">
       <a href="base.AGObject-class.html">base.AGObject</a> --+    
                       |    
          object --+   |    
                   |   |    
pygame.sprite.Sprite --+    
                       |    
                <a href="spaceship.AGSprite-class.html">AGSprite</a> --+
                           |
                          <strong class="uidshort">Bonus</strong>
</pre>

<dl><dt>Known Subclasses:</dt>
<dd>
    <a href="spaceship.RechargeBonus-class.html">RechargeBonus</a>,
    <a href="spaceship.ShieldUpgradeBonus-class.html">ShieldUpgradeBonus</a>,
    <a href="spaceship.SuperShieldBonus-class.html">SuperShieldBonus</a>
</dd></dl>

<hr />
<p>Base class for bonuses/powerups that can be collected by players. 
  Bonuses collide with objects belonging to group 'ship'.</p>
  W momencie kolizji wywolywana jest metoda, ktorej argumentem jest 
  referencja do obiektu, z ktorym nastapila kolizja. Ta metoda ma za 
  zadanie wywolac jakis pozytywny dla obiektu efekt.<br /><br />

<!-- ==================== INSTANCE METHODS ==================== -->
<a name="section-InstanceMethods"></a>
<table class="summary" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td colspan="2" class="table-header">
    <table border="0" cellpadding="0" cellspacing="0" width="100%">
      <tr valign="top">
        <td align="left"><span class="table-header">Instance Methods</span></td>
        <td align="right" valign="top"
         ><span class="options">[<a href="#section-InstanceMethods"
         class="privatelink" onclick="toggle_private();"
         >hide private</a>]</span></td>
      </tr>
    </table>
  </td>
</tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="spaceship.Bonus-class.html#__init__" class="summary-sig-name">__init__</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">pos</span>,
        <span class="summary-sig-arg">params</span>=<span class="summary-sig-default"><code class="variable-group">{</code><code class="variable-group">}</code></span>,
        <span class="summary-sig-arg">*groups</span>)</span><br />
      Create bonus instance.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="spaceship-pysrc.html#Bonus.__init__">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr class="private">
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a name="_detect_collisions"></a><span class="summary-sig-name">_detect_collisions</span>(<span class="summary-sig-arg">self</span>)</span><br />
      Detect collisions and return single colliding ship or None.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="spaceship-pysrc.html#Bonus._detect_collisions">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="spaceship.Bonus-class.html#update" class="summary-sig-name">update</a>(<span class="summary-sig-arg">self</span>)</span><br />
      Update position and animations.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="spaceship-pysrc.html#Bonus.update">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr class="private">
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="spaceship.Bonus-class.html#_use" class="summary-sig-name">_use</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">ship</span>)</span><br />
      Use bonus on <code>ship</code>.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="spaceship-pysrc.html#Bonus._use">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
  <tr>
    <td colspan="2" class="summary">
    <p class="indent-wrapped-lines"><b>Inherited from <code><a href="spaceship.AGSprite-class.html">AGSprite</a></code></b>:
      <code><a href="spaceship.AGSprite-class.html#closest">closest</a></code>,
      <code><a href="spaceship.AGSprite-class.html#distance">distance</a></code>,
      <code><a href="spaceship.AGSprite-class.html#is_offscreen">is_offscreen</a></code>,
      <code><a href="spaceship.AGSprite-class.html#kill">kill</a></code>,
      <code><a href="spaceship.AGSprite-class.html#set_mover">set_mover</a></code>
      </p>
    <div class="private">    <p class="indent-wrapped-lines"><b>Inherited from <code><a href="spaceship.AGSprite-class.html">AGSprite</a></code></b> (private):
      <code><a href="spaceship.AGSprite-class.html#_blit_state">_blit_state</a></code>,
      <code><a href="spaceship.AGSprite-class.html#_check_cfg">_check_cfg</a></code>,
      <code><a href="spaceship.AGSprite-class.html#_check_gfx">_check_gfx</a></code>,
      <code><a href="spaceship.AGSprite-class.html#_init_animation">_init_animation</a></code>,
      <code><a href="spaceship.AGSprite-class.html#_initialize_position">_initialize_position</a></code>,
      <code><a href="spaceship.AGSprite-class.html#_state_area">_state_area</a></code>,
      <code><a href="spaceship.AGSprite-class.html#_update_animations">_update_animations</a></code>,
      <code><a href="spaceship.AGSprite-class.html#_update_position">_update_position</a></code>
      </p></div>
    <div class="private">    <p class="indent-wrapped-lines"><b>Inherited from <code><a href="base.AGObject-class.html">base.AGObject</a></code></b> (private):
      <code><a href="base.AGObject-class.html#_setattrs">_setattrs</a></code>
      </p></div>
    <p class="indent-wrapped-lines"><b>Inherited from <code>pygame.sprite.Sprite</code></b>:
      <code>__repr__</code>,
      <code>add</code>,
      <code>add_internal</code>,
      <code>alive</code>,
      <code>groups</code>,
      <code>remove</code>,
      <code>remove_internal</code>
      </p>
    <p class="indent-wrapped-lines"><b>Inherited from <code>object</code></b>:
      <code>__delattr__</code>,
      <code>__getattribute__</code>,
      <code>__hash__</code>,
      <code>__new__</code>,
      <code>__reduce__</code>,
      <code>__reduce_ex__</code>,
      <code>__setattr__</code>,
      <code>__str__</code>
      </p>
    </td>
  </tr>
</table>
<!-- ==================== STATIC METHODS ==================== -->
<a name="section-StaticMethods"></a>
<table class="summary" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td colspan="2" class="table-header">
    <table border="0" cellpadding="0" cellspacing="0" width="100%">
      <tr valign="top">
        <td align="left"><span class="table-header">Static Methods</span></td>
        <td align="right" valign="top"
         ><span class="options">[<a href="#section-StaticMethods"
         class="privatelink" onclick="toggle_private();"
         >hide private</a>]</span></td>
      </tr>
    </table>
  </td>
</tr>
  <tr>
    <td colspan="2" class="summary">
    <div class="private">    <p class="indent-wrapped-lines"><b>Inherited from <code><a href="spaceship.AGSprite-class.html">AGSprite</a></code></b> (private):
      <code><a href="spaceship.AGSprite-class.html#_closest_compare_dists">_closest_compare_dists</a></code>
      </p></div>
    </td>
  </tr>
</table>
<!-- ==================== INSTANCE VARIABLES ==================== -->
<a name="section-InstanceVariables"></a>
<table class="summary" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td colspan="2" class="table-header">
    <table border="0" cellpadding="0" cellspacing="0" width="100%">
      <tr valign="top">
        <td align="left"><span class="table-header">Instance Variables</span></td>
        <td align="right" valign="top"
         ><span class="options">[<a href="#section-InstanceVariables"
         class="privatelink" onclick="toggle_private();"
         >hide private</a>]</span></td>
      </tr>
    </table>
  </td>
</tr>
  <tr>
    <td colspan="2" class="summary">
    <p class="indent-wrapped-lines"><b>Inherited from <code><a href="spaceship.AGSprite-class.html">AGSprite</a></code></b>:
      <code><a href="spaceship.AGSprite-class.html#align">align</a></code>,
      <code><a href="spaceship.AGSprite-class.html#center">center</a></code>,
      <code><a href="spaceship.AGSprite-class.html#cfg">cfg</a></code>,
      <code><a href="spaceship.AGSprite-class.html#gfx">gfx</a></code>,
      <code><a href="spaceship.AGSprite-class.html#max_speed">max_speed</a></code>,
      <code><a href="spaceship.AGSprite-class.html#mover">mover</a></code>,
      <code><a href="spaceship.AGSprite-class.html#offscreen_lifetime">offscreen_lifetime</a></code>,
      <code><a href="spaceship.AGSprite-class.html#offscreen_time">offscreen_time</a></code>,
      <code><a href="spaceship.AGSprite-class.html#pos">pos</a></code>,
      <code><a href="spaceship.AGSprite-class.html#screen_size">screen_size</a></code>
      </p>
    <div class="private">    <p class="indent-wrapped-lines"><b>Inherited from <code><a href="spaceship.AGSprite-class.html">AGSprite</a></code></b> (private):
      <code><a href="spaceship.AGSprite-class.html#_animations">_animations</a></code>,
      <code><a href="spaceship.AGSprite-class.html#_overlay">_overlay</a></code>
      </p></div>
    <p class="indent-wrapped-lines"><b>Inherited from <code><a href="base.AGObject-class.html">base.AGObject</a></code></b>:
      <code><a href="base.AGObject-class.html#clock">clock</a></code>
      </p>
    </td>
  </tr>
</table>
<!-- ==================== PROPERTIES ==================== -->
<a name="section-Properties"></a>
<table class="summary" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td colspan="2" class="table-header">
    <table border="0" cellpadding="0" cellspacing="0" width="100%">
      <tr valign="top">
        <td align="left"><span class="table-header">Properties</span></td>
        <td align="right" valign="top"
         ><span class="options">[<a href="#section-Properties"
         class="privatelink" onclick="toggle_private();"
         >hide private</a>]</span></td>
      </tr>
    </table>
  </td>
</tr>
  <tr>
    <td colspan="2" class="summary">
    <p class="indent-wrapped-lines"><b>Inherited from <code>object</code></b>:
      <code>__class__</code>
      </p>
    </td>
  </tr>
</table>
<!-- ==================== METHOD DETAILS ==================== -->
<a name="section-MethodDetails"></a>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td colspan="2" class="table-header">
    <table border="0" cellpadding="0" cellspacing="0" width="100%">
      <tr valign="top">
        <td align="left"><span class="table-header">Method Details</span></td>
        <td align="right" valign="top"
         ><span class="options">[<a href="#section-MethodDetails"
         class="privatelink" onclick="toggle_private();"
         >hide private</a>]</span></td>
      </tr>
    </table>
  </td>
</tr>
</table>
<a name="__init__"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">__init__</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">pos</span>,
        <span class="sig-arg">params</span>=<span class="sig-default"><code class="variable-group">{</code><code class="variable-group">}</code></span>,
        <span class="sig-arg">*groups</span>)</span>
    <br /><em class="fname">(Constructor)</em>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="spaceship-pysrc.html#Bonus.__init__">source&nbsp;code</a></span>&nbsp;
    </td>
  </table>
  
  Create bonus instance. Initialize its <code>image</code> and 
  <code>rect</code>.
  <dl class="fields">
    <dt>Overrides:
      <a href="spaceship.AGSprite-class.html#__init__">AGSprite.__init__</a>
    </dt>
  </dl>
</td></tr></table>
</div>
<a name="update"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">update</span>(<span class="sig-arg">self</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="spaceship-pysrc.html#Bonus.update">source&nbsp;code</a></span>&nbsp;
    </td>
  </table>
  
  Update position and animations. Kill object if it is off the screen 
  for too long.
  <dl class="fields">
    <dt>Overrides:
      <a href="spaceship.AGSprite-class.html#update">AGSprite.update</a>
        <dd><em class="note">(inherited documentation)</em></dd>
    </dt>
  </dl>
</td></tr></table>
</div>
<a name="_use"></a>
<div class="private">
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">_use</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">ship</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="spaceship-pysrc.html#Bonus._use">source&nbsp;code</a></span>&nbsp;
    </td>
  </table>
  
  Use bonus on <code>ship</code>. Classes derived from 
  <code>Bonus</code> need to override this method.
  <dl class="fields">
  </dl>
</td></tr></table>
</div>
<br />
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

      <th class="navbar" width="100%"></th>
  </tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="100%%">
  <tr>
    <td align="left" class="footer">
    Generated by Epydoc 3.0beta1 on Thu Jul 31 17:03:02 2008
    </td>
    <td align="right" class="footer">
      <a href="http://epydoc.sourceforge.net">http://epydoc.sourceforge.net</a>
    </td>
  </tr>
</table>

<script type="text/javascript">
  <!--
  // Private objects are initially displayed (because if
  // javascript is turned off then we want them to be
  // visible); but by default, we want to hide them.  So hide
  // them unless we have a cookie that says to show them.
  checkCookie()
  // -->
</script>
  
</body>
</html>
